package com.ssn.iterator;

import java.util.ArrayList;

public class MyAggregate<T> implements Aggregate<T>{
    private ArrayList<T> arrayList = new ArrayList<>();
    @Override
    public Iterator iterator() {
        return new MyIterator(this);
    }

    @Override
    public void addItem(T t) {
        arrayList.add(t);
    }

    @Override
    public ArrayList<T> getAggregate() {
        return arrayList;
    }
}
